package edu.ustb.efws.pipeline.domain;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Date;
import java.util.Objects;

/**
 * 功率变送器设备数据采集日志
 *
 * @author TS Group
 */
public class IptLog {
    @ApiModelProperty("编号")
    private Long id;
    @ApiModelProperty("传感器编号")
    private Integer detectorId;
    @ApiModelProperty("月份(yyyyMM)")
    private Integer month;
    @ApiModelProperty("电流1")
    private Float i1;
    @ApiModelProperty("电流2")
    private Float i2;
    @ApiModelProperty("电流3")
    private Float i3;
    @ApiModelProperty("最大电流")
    private Float maxI;
    @ApiModelProperty("电压1")
    private Float u1;
    @ApiModelProperty("电压2")
    private Float u2;
    @ApiModelProperty("电压3")
    private Float u3;
    @ApiModelProperty("最大电压")
    private Float maxU;
    @ApiModelProperty("功率")
    private Float p;
    @ApiModelProperty("采集时间")
    private Date collectTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getDetectorId() {
        return detectorId;
    }

    public void setDetectorId(Integer detectorId) {
        this.detectorId = detectorId;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public Float getI1() {
        return i1;
    }

    public void setI1(Float i1) {
        this.i1 = i1;
    }

    public Float getI2() {
        return i2;
    }

    public void setI2(Float i2) {
        this.i2 = i2;
    }

    public Float getI3() {
        return i3;
    }

    public void setI3(Float i3) {
        this.i3 = i3;
    }

    public Float getMaxI() {
        return maxI;
    }

    public void setMaxI(Float maxI) {
        this.maxI = maxI;
    }

    public Float getU1() {
        return u1;
    }

    public void setU1(Float u1) {
        this.u1 = u1;
    }

    public Float getU2() {
        return u2;
    }

    public void setU2(Float u2) {
        this.u2 = u2;
    }

    public Float getU3() {
        return u3;
    }

    public void setU3(Float u3) {
        this.u3 = u3;
    }

    public Float getMaxU() {
        return maxU;
    }

    public void setMaxU(Float maxU) {
        this.maxU = maxU;
    }

    public Float getP() {
        return p;
    }

    public void setP(Float p) {
        this.p = p;
    }

    public Date getCollectTime() {
        return collectTime;
    }

    public void setCollectTime(Date collectTime) {
        this.collectTime = collectTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IptLog log = (IptLog) o;
        return Objects.equals(id, log.id) &&
                Objects.equals(detectorId, log.detectorId) &&
                Objects.equals(month, log.month) &&
                Objects.equals(i1, log.i1) &&
                Objects.equals(i2, log.i2) &&
                Objects.equals(i3, log.i3) &&
                Objects.equals(maxI, log.maxI) &&
                Objects.equals(u1, log.u1) &&
                Objects.equals(u2, log.u2) &&
                Objects.equals(u3, log.u3) &&
                Objects.equals(maxU, log.maxU) &&
                Objects.equals(p, log.p) &&
                Objects.equals(collectTime, log.collectTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, detectorId, month, i1, i2, i3, maxI, u1, u2, u3, maxU, p, collectTime);
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("detectorId", detectorId)
                .append("month", month)
                .append("i1", i1)
                .append("i2", i2)
                .append("i3", i3)
                .append("maxI", maxI)
                .append("u1", u1)
                .append("u2", u2)
                .append("u3", u3)
                .append("maxU", maxU)
                .append("p", p)
                .append("collectTime", collectTime)
                .toString();
    }
}
